package com.xgzit.xgzmall.auth.vo;

import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * 注册数据Vo
 * 使用jsr303 校验注解
 * @Author xgz
 * @Date 2021-06-01 7:29
 */
@ToString
@Data
public class UserRegisterVo {

    @NotEmpty(message = "用户名 不能为空！")
    @Length(min = 6, max = 18, message = "用户名最小 6位，最大18！")
    private String userName;

    @NotEmpty(message = "密码 不能为空！")
    @Length(min = 6, max = 18, message = "密码最小 6位，最大18！")
    private String password;

    @NotEmpty(message = "手机号 不能为空！")
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$", message = "手机号格式错误！")
    private String phone;

    @NotEmpty(message = "验证码 不能为空！")
    private String code;
}
